package cn.sangyy.org.mapper;

import cn.sangyy.org.domain.Department;
import cn.sangyy.org.query.DepQuery;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.io.Serializable;
import java.util.List;

/**
 * @author sangYY
 * @date: 2023/04/23/15:35
 */
@Repository
public interface DepartmentMapper {
    /**
    * @author Sangyy
    * 新增部门
    */
    int insert(Department department);
    /**
     * @author Sangyy
     * 删除部门
     */
    int deleteById(Serializable id);
    /**
     * @author Sangyy
     * 修改部门信息
     */
    int update(Department department);
    /**
     * @author Sangyy
     * 通过id查部门
     */
    Department getDepById(Serializable id);

    /**
     * @author Sangyy
     * 查所有部门
     */
    List<Department> getAllDep();

    Long getTotals(@Param("keyword") String keyword);

    List<Department> getRows(DepQuery depQuery);

    void batchDelete(List<Long> ids);

    List<Department> depTree();
}
